<?php

define('URL', 'http://192.168.56.1/');
define('URL_AVATAR', URL . 'upload/image/avatar/');
define('URL_CIRCLE', URL . 'upload/image/circle/');

function redirection($url)
{
    header('Location: ' . $url);
    die();
}

function output_data($data)
{
    header("Content-Type: application/json; charset=UTF-8");
    $array = array();
    $array['code'] = 1;
    $array['msg'] = 'success';
    $array['data'] = $data;
    echo json_encode($array);
    die();
}

function output_error($msg)
{
    header("Content-Type: application/json; charset=UTF-8");
    $array = array();
    $array['code'] = 2;
    $array['msg'] = $msg;
    $array['data'] = '';
    echo json_encode($array);
    die();
}
